package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.ScoreRulesV2Dao;
import cn.topevery.garden.entity.fetch.ScoreRulesV2Fetch;
import cn.topevery.garden.entity.po.ScoreRulesV2;
import cn.topevery.garden.entity.query.ScoreRulesV2Query;
import cn.topevery.garden.entity.vo.ScoreRulesV2VO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-07
 */
@Service
public class ScoreRulesV2Logic extends BaseLogic<ScoreRulesV2> {
    @Autowired
    ScoreRulesV2Dao scoreRulesV2Dao;

    @Override
    public BaseEntityDao<ScoreRulesV2, Integer> getDao() {
        return scoreRulesV2Dao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<ScoreRulesV2VO> listPage(ScoreRulesV2Query query) {
        return scoreRulesV2Dao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        scoreRulesV2Dao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param scoreRulesV2 实体
     */
    public void saveOrUpdate(String userId, ScoreRulesV2 scoreRulesV2){
        scoreRulesV2Dao.saveOrUpdate(userId,scoreRulesV2);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public ScoreRulesV2 getEntityByColumn(String key, String value) {
        return scoreRulesV2Dao.getEntityByColumn(key, value);
    }

    public DataPager<ScoreRulesV2> getList(ScoreRulesV2Fetch query) {
        return scoreRulesV2Dao.getList(query);
    }

    public DataPager<ScoreRulesV2> getHisList(ScoreRulesV2Fetch query) {
        return scoreRulesV2Dao.getHisList(query);
    }

}
